
test-convert.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <main>:
    char type;  
    int age;  
};  
  
int main()  
{  
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd010 	sub	sp, sp, #16
    struct A a;  
    a.num=1;  
   c:	e3a03001 	mov	r3, #1
  10:	e50b3014 	str	r3, [fp, #-20]	; 0xffffffec
  
    char* tmp1=(char *)(&(a.num)); 
  14:	e24b3014 	sub	r3, fp, #20
  18:	e50b3008 	str	r3, [fp, #-8]
	
	printf("%d\n", *tmp1);	// 1
  1c:	e51b3008 	ldr	r3, [fp, #-8]
  20:	e5d33000 	ldrb	r3, [r3]
  24:	e1a01003 	mov	r1, r3
  28:	e59f0084 	ldr	r0, [pc, #132]	; b4 <main+0xb4>
  2c:	ebfffffe 	bl	0 <printf>

    tmp1=tmp1+4;  
  30:	e51b3008 	ldr	r3, [fp, #-8]
  34:	e2833004 	add	r3, r3, #4
  38:	e50b3008 	str	r3, [fp, #-8]

	printf("%d\n", *tmp1);	// -128
  3c:	e51b3008 	ldr	r3, [fp, #-8]
  40:	e5d33000 	ldrb	r3, [r3]
  44:	e1a01003 	mov	r1, r3
  48:	e59f0064 	ldr	r0, [pc, #100]	; b4 <main+0xb4>
  4c:	ebfffffe 	bl	0 <printf>

    *tmp1='a';  
  50:	e51b3008 	ldr	r3, [fp, #-8]
  54:	e3a02061 	mov	r2, #97	; 0x61
  58:	e5c32000 	strb	r2, [r3]

    int *tmp2=(int *)(&(a.num));  
  5c:	e24b3014 	sub	r3, fp, #20
  60:	e50b300c 	str	r3, [fp, #-12]

    tmp2=tmp2+2;  
  64:	e51b300c 	ldr	r3, [fp, #-12]
  68:	e2833008 	add	r3, r3, #8
  6c:	e50b300c 	str	r3, [fp, #-12]

    *tmp2=100;  
  70:	e51b300c 	ldr	r3, [fp, #-12]
  74:	e3a02064 	mov	r2, #100	; 0x64
  78:	e5832000 	str	r2, [r3]
  
    struct B *b=(struct B *)(&a);  
  7c:	e24b3014 	sub	r3, fp, #20
  80:	e50b3010 	str	r3, [fp, #-16]
  
    printf(" b->num=%d  b->type=%c  b->age=%d \n",b->num,b->type,b->age);	
  84:	e51b3010 	ldr	r3, [fp, #-16]
  88:	e5931000 	ldr	r1, [r3]
  8c:	e51b3010 	ldr	r3, [fp, #-16]
  90:	e5d33004 	ldrb	r3, [r3, #4]
  94:	e1a02003 	mov	r2, r3
  98:	e51b3010 	ldr	r3, [fp, #-16]
  9c:	e5933008 	ldr	r3, [r3, #8]
  a0:	e59f0010 	ldr	r0, [pc, #16]	; b8 <main+0xb8>
  a4:	ebfffffe 	bl	0 <printf>
	// output:
	// b->num=1  b->type=P  b->age=100
}  
  a8:	e1a00003 	mov	r0, r3
  ac:	e24bd004 	sub	sp, fp, #4
  b0:	e8bd8800 	pop	{fp, pc}
  b4:	00000000 	.word	0x00000000
  b8:	00000004 	.word	0x00000004
